package com.zjq.smartdevice.mapper;

import com.zjq.smartdevice.pojo.SysHumiture;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * @User zhangjiaqi
 * @Project project
 * @Package com.zjq.smartdevice.mapper
 * @Date 2022/3/27 21:36
 */
public interface SysHumitureMapper {

    @Insert("INSERT INTO sys_humiture (device_id,humidity,temperature,upload_time) VALUES(#{deviceId},#{humidity},#{temperature},#{uploadTime})")
    void addSysHumiture(SysHumiture sysHumiture);

    @Select("SELECT * FROM sys_humiture WHERE upload_time BETWEEN #{start} and #{stop}")
    List<SysHumiture> findDataByTime(@Param("start") Date start, @Param("stop") Date stop);
}
